/**************************************
 * This is a class for instantiating  *
 * and creating a Win32 Window.       *
 **************************************/

#ifndef WINDOW_H
#define WINDOW_H

//Smaller Windows Library
#define WIN32_LEAN_AND_MEAN

//Include Win32 library
#include <windows.h>

//Default Window Properties
#define WIN_CLS_NAME L"Application"
#define WIN_TITLE L"Window"

//Callback Function Declaration
LRESULT CALLBACK WindowProcedure (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

//DXDevice Forward Class Declaration
class DXDevice;

//Window Class Declaration
class Window
{
	friend DXDevice;

	public:
		//Constructors
		Window (void);
		Window (HINSTANCE Instance, LPCWSTR Title, int Width, int Height, BOOL Fullscreen = FALSE);
		//Destructor
		~Window (void);

		//Public Methods
		BOOL InitWindow (HINSTANCE Instance, LPCWSTR Title, int Width, int Height, BOOL Fullscreen = FALSE);
		void Show (void);
		BOOL UpdateWindowMsg (void);

		//Getters
		HINSTANCE GetWindowInstance (void);
		HWND GetWindowHandle (void);
		UINT GetScreenWidth (void);
		UINT GetScreenHeight (void);

	private:
		//Private Methods
		BOOL BuildWindow (void);
		BOOL BuildWndClassEx (void);
		BOOL BuildWndHandle (void);

		//Window Members
		HINSTANCE hInstance;
		HWND hWnd;
		BOOL FullScreen;
		LPCWSTR WindowTitle;
		UINT ScreenWidth, ScreenHeight;
		UINT ColorDepth;
		MSG Msg;
		WNDCLASSEX* WndClassEx;
		BOOL Running;
};

#endif

/************************ Sample WinMain ************************

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, 
					LPSTR lpCmdLine, int nShowCmd)
{
	Window testWindow (hInstance, L"Win32 Test", 800, 600);

	testWindow.showWindow ();

	while (GetMessage (testWindow.getWindowMessage (), NULL, 0, 0))
	{
		TranslateMessage (testWindow.getWindowMessage ());
		DispatchMessage (testWindow.getWindowMessage ());
	}

	return (int)(testWindow.getWindowMessage ())->wParam;
}

****************************************************************/